package com.warehouse.module.business.dal.mysql.cargoplan;

import com.warehouse.framework.common.pojo.PageResult;
import com.warehouse.framework.mybatis.core.mapper.BaseMapperX;
import com.warehouse.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.warehouse.module.business.controller.admin.cargoinfo.vo.CargoInfoRespVO;
import com.warehouse.module.business.controller.admin.cargoplan.vo.CargoPlanPageReqVO;
import com.warehouse.module.business.dal.dataobject.cargofile.CargoFileDO;
import com.warehouse.module.business.dal.dataobject.cargoplan.CargoPlanDO;
import com.warehouse.module.business.dal.dataobject.company.CompanyDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CargoPlanMapper extends BaseMapperX<CargoPlanDO>{


    default PageResult<CargoPlanDO> selectPage(CargoPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CargoPlanDO>()
                .betweenIfPresent(CargoPlanDO::getPlanTime, reqVO.getPlanTime())
                .orderByDesc(CargoPlanDO::getPlanTime));
    }

    List<CargoInfoRespVO> listCargoInfosByPlanId(@Param("id") Long id);
}
